package es.uv.bd.controller;

import es.uv.bd.view.Bodegalia.BodegaliaView;
import es.uv.bd.view.FrmBodegalia;
import es.uv.bd.view.Bodega.BodegasView;
import es.uv.bd.view.Vino.VinosView_1;
import java.awt.Component;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class BodegaliaController {
    private Component c;
    
    public BodegaliaController(BodegaliaView view) {
        view.setMenuActionListener(new MenuActionListener());
    }
    
    class MenuActionListener implements ActionListener {
        @Override
        public void actionPerformed(ActionEvent event) {
       
            String key   = event.getActionCommand();
            switch (key) {
                case "menuExportar":
                    System.out.println("MenuActionListener: Accion '" + key + "' no implementada.");
                    break;
                case "menuExit":
                    System.exit(0);
                    break;
                case "menuBodegas":
                    Frame BodegasView = new BodegasView();
                    BodegasView.setVisible(true);
                    break;
                case "menuVinos":
                    Frame VinosView = new VinosView_1();
                    VinosView.setVisible(true);
                    break;
                case "menuExplorar":
                    Frame frmAnimalia = new FrmBodegalia();
                    frmAnimalia.setVisible(true);
                    break;
                default:
                    System.out.println("MenuActionListener: Acción '" + key + "' desconocida.");
                    break;
            }
        }
    }
}
